home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / flabel.exe / FLABELS1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-20  |  5.3 KB  |  167 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    Caption         =   "FLabel Sample"
  5.    ClientHeight    =   3255
  6.    ClientLeft      =   1665
  7.    ClientTop       =   2400
  8.    ClientWidth     =   6630
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   0
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    ForeColor       =   &H80000008&
  19.    Height          =   3660
  20.    Left            =   1605
  21.    LinkTopic       =   "Form1"
  22.    ScaleHeight     =   3255
  23.    ScaleWidth      =   6630
  24.    Top             =   2055
  25.    Width           =   6750
  26.    Begin VB.CommandButton Command2 
  27.       Caption         =   "Exit"
  28.       BeginProperty Font 
  29.          name            =   "MS Sans Serif"
  30.          charset         =   0
  31.          weight          =   400
  32.          size            =   8.25
  33.          underline       =   0   'False
  34.          italic          =   0   'False
  35.          strikethrough   =   0   'False
  36.       EndProperty
  37.       Height          =   375
  38.       Left            =   3480
  39.       TabIndex        =   2
  40.       Top             =   2640
  41.       Width           =   1575
  42.    End
  43.    Begin VB.CommandButton Command1 
  44.       Caption         =   "Print"
  45.       BeginProperty Font 
  46.          name            =   "MS Sans Serif"
  47.          charset         =   0
  48.          weight          =   400
  49.          size            =   8.25
  50.          underline       =   0   'False
  51.          italic          =   0   'False
  52.          strikethrough   =   0   'False
  53.       EndProperty
  54.       Height          =   375
  55.       Left            =   1680
  56.       TabIndex        =   1
  57.       Top             =   2640
  58.       Width           =   1575
  59.    End
  60.    Begin VB.TextBox Text1 
  61.       BeginProperty Font 
  62.          name            =   "MS Sans Serif"
  63.          charset         =   0
  64.          weight          =   400
  65.          size            =   8.25
  66.          underline       =   0   'False
  67.          italic          =   0   'False
  68.          strikethrough   =   0   'False
  69.       EndProperty
  70.       Height          =   2175
  71.       Left            =   3480
  72.       MultiLine       =   -1  'True
  73.       TabIndex        =   0
  74.       Text            =   "FLABELS1.frx":0000
  75.       Top             =   240
  76.       Width           =   2895
  77.    End
  78.    Begin FlabelLib.FLabel FLabel1 
  79.       Height          =   2175
  80.       Left            =   240
  81.       TabIndex        =   3
  82.       Top             =   240
  83.       Width           =   3015
  84.       _Version        =   65537
  85.       _ExtentX        =   5318
  86.       _ExtentY        =   3836
  87.       _StockProps     =   77
  88.       BackColor       =   -2147483643
  89.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  90.          name            =   "MS Sans Serif"
  91.          charset         =   0
  92.          weight          =   400
  93.          size            =   8.25
  94.          underline       =   0   'False
  95.          italic          =   0   'False
  96.          strikethrough   =   0   'False
  97.       EndProperty
  98.       AutoSize        =   0   'False
  99.       BackStyle       =   0
  100.       Caption         =   "FLabel1"
  101.       Delimiter       =   "|"
  102.       ParaBefore      =   0
  103.       ParaFirst       =   0
  104.       ParaLeft        =   0
  105.       ParaRight       =   0
  106.       WordWrap        =   0   'False
  107.    End
  108. Attribute VB_Name = "Form1"
  109. Attribute VB_Creatable = False
  110. Attribute VB_Exposed = False
  111. Option Explicit
  112. Private Sub Command1_Click()
  113.     Printer.Print
  114.     ' draw box
  115.     Printer.Line (1320, 1320)-Step(6000, 1680), , B
  116.     ' set up printer
  117.     FLabel1.PrinterScaleMode = Printer.ScaleMode
  118.     ' print at left = 1", top = 1"
  119.     ' height = 1", width = 4"
  120.     FLabel1.PrinterTop = 1440
  121.     FLabel1.PrinterLeft = 1440
  122.     FLabel1.PrinterHeight = 1440
  123.     FLabel1.PrinterWidth = 4 * 1440
  124.     ' print
  125.     FLabel1.PrinterHDC = Printer.hDC
  126.     ' make sure printer object knows something has
  127.     ' happened
  128.     Printer.Print ""
  129.     ' end job
  130.     Printer.EndDoc
  131. End Sub
  132. Private Sub Command2_Click()
  133.     ' get out
  134.     End
  135. End Sub
  136. Private Sub Form_Load()
  137.     FLabel1.ParaBefore = 240
  138.     FLabel1.ParaFirst = 480
  139.     FLabel1.WordWrap = True
  140.     Text1.Text = "This is a test of |color:blue|FLabel VBX|color:black|.  Play with this text to change the formatting.  Then, try printing it.  You should see your text inside a box.|cr|It's fun ..."
  141. End Sub
  142. Private Sub Form_Resize()
  143.     FLabel1.Top = 240
  144.     FLabel1.Left = 240
  145.     FLabel1.Width = (Form1.ScaleWidth / 2) - 360
  146.     FLabel1.Height = Form1.ScaleHeight - 1080
  147.     Text1.Top = 240
  148.     Text1.Left = (Form1.ScaleWidth / 2) + 120
  149.     Text1.Width = (Form1.ScaleWidth / 2) - 360
  150.     Text1.Height = Form1.ScaleHeight - 1080
  151.     Command1.Top = Form1.ScaleHeight - 600
  152.     Command1.Left = (Form1.ScaleWidth / 2) - Command1.Width - 120
  153.     Command2.Top = Form1.ScaleHeight - 600
  154.     Command2.Left = (Form1.ScaleWidth / 2) + 120
  155. End Sub
  156. Private Sub Text1_Change()
  157.     Dim Offset As Integer
  158.     Dim Temp As String
  159.     Temp = Text1.Text
  160.     Do While InStr(Temp, Chr(13) & Chr(10))
  161.         Offset = InStr(Temp, Chr(13) & Chr(10))
  162.         Temp = Left(Temp, Offset - 1) & "|CR|" & Mid(Temp, Offset + 2)
  163.     Loop
  164.     Text1.Text = Temp
  165.     FLabel1.Caption = Temp
  166. End Sub
  167.